package info.ask4research.model;

import info.ask4research.model.enums.ResourceType;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;


@Entity
@JsonAutoDetect
@Table(name="Files")
public class FileUploadBean {

	@Id
	@GeneratedValue
	@Column(name="file_ID")
	private int id;
	@Lob
	@Column(name = "bytes")
	@JsonIgnore
	private byte[] bytes;
	@Column(name="name")
	private String name;
	@Column(name="size")
	private long size;
	@Enumerated(EnumType.STRING)
	@Column(name="resourceType")
	private ResourceType resourceType; 
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public byte[] getBytes() {
		return bytes;
	}
	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public long getSize() {
		return size;
	}
	public void setSize(long size) {
		this.size = size;
	}
	public ResourceType getResourceType() {
		return resourceType;
	}
	public void setResourceType(ResourceType resourceType) {
		this.resourceType = resourceType;
	}
}
